<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%String path=request.getContextPath();%>

<html>
  <head>
    
    <title>readnote hello</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	<script language="JavaScript" type="text/javascript" src="<%=path%>/hypertextarea/HyperTextArea.js"></script>
	-->
  </head>
  
  <body>
    <h5>userBook Note update. </h5>
    
	<s:form name="saveNoteForm" action="save.do" namespace="/center/userNote/" method="post" cssClass="simple">
		<table id="inputTable">
			<tr>
				<td>我的书籍列表：</td><td>	<s:select list="userBooks" listKey="id" listValue="book.title" name="userNote.userBook.id" value="%{userBook.id}"></s:select></td>
			</tr>
			<tr>
				<td>页码：</td><td><s:textfield name="userNote.pageNumber" /></td>
			</tr>
			<tr>
				<td>笔记标题：</td><td><s:textfield name="userNote.title" /></td>
			</tr>
			<tr>
				<td >笔记内容：</td>
				<td >
			
				<!-- 使用kindeditor，需要引用的资源文件  -->
				<link rel="stylesheet" href="<%=path%>/kindeditor/themes/default/default.css" />
				<link rel="stylesheet" href="<%=path%>/kindeditor/plugins/code/prettify.css" />
				<script charset="utf-8" src="<%=path%>/kindeditor/kindeditor-min.js"></script>
				<script charset="utf-8" src="<%=path%>/kindeditor/lang/zh_CN.js"></script>
				<script charset="utf-8" src="<%=path%>/kindeditor/plugins/code/prettify.js"></script>
				<!-- cssPath : '../plugins/code/prettify.css',  -->	
				<script>
			
					KindEditor.ready(function(K) {
						var editor1 = K.create('textarea[name="userNote.content"]', {
							uploadJson : '../jsp/upload_json.jsp',
							fileManagerJson : '../jsp/file_manager_json.jsp',
							allowFileManager : true,
							afterCreate : function() {
								var self = this;
								K.ctrl(document, 13, function() {
									self.sync();
									document.forms['example'].submit();
								});
								K.ctrl(self.edit.doc, 13, function() {
									self.sync();
									document.forms['saveNoteForm'].submit();
								});
							}
						});
						prettyPrint();
					});
				</script>
				<textarea name="userNote.content" cols="120" rows="17"><s:property value="userNote.content"/></textarea>
				
				</td>
			</tr>
		</table>
		
		<!--
		 	笔记id
		 -->
		<s:hidden name="userNote.id" />
		
		<input type="submit" name="button" value="kingEditor提交内容" /> (提交快捷键: Ctrl + Enter)
	</s:form>
  </body>
</html>
